#include "../source/server.hpp"

int main()
{
    Socket cli_sock;
    cli_sock.CreateClient(8500, "127.0.0.1");
    for (int i = 0; i < 5; i++) 
    {
        std::string str = "hello bitejiuyeke!";
        cli_sock.Send(str.c_str(), str.size());
        char buf[1024] = {0};
        cli_sock.Recv(buf, 1023);
        DBG_LOG("%s", buf);
        sleep(1);
    }
    //while(1) sleep(1);
    return 0;
}

/*#include "../source/server.hpp"

//这是Socket类Client的测试
int main()
{
    Socket cli_sock;
    cli_sock.CreateClient(8500,"127.0.0.1");
    for(int i=0;i<5;i++)
    {
        std::cout<<"test: ";
        std::string str="hello socket";
        std::cout<<str<<std::endl;
        cli_sock.Send(str.c_str(),str.size());
            std::cout<<"Send Success"<<std::endl;
        
        char buf[1024]={0};
        DBG_LOG("%s",buf);
        cli_sock.Recv(buf,1023);
            std::cout<<"Recv Success"<<std::endl;

        //std::cout<<buf<<std::endl;
        DBG_LOG("%s",buf);
        sleep(1);
    }
    while(1) sleep(1);
    return 0;
}
*/